/**
 * Created by Administrator on 2017/4/26 0026.
 */
//添加cookie
function setCookie(name,value,time){
    var oDate = new Date();
    oDate.setDate(oDate.getDate()+time);
    document.cookie = name+"="+value+";expires="+oDate;
}

//获取cookie
function getCookie(name){
    var arr = document.cookie.split("; ");
    for(var i=0; i<arr.length; i++){
        var arr2 = arr[i].split("=");
        if(arr2[0] == name){
            return arr2[1];
        }
    }
    return "";
}

//移出cookie
function removeCookie(name){
    setCookie(name,"",0)//将cookie置空
}